<template>
  <div class="mini-chart">
    <div class="chart-content" :style="{height: 88}">
      <v-chart :force-fit="true" :height="height" :data="coverList" :padding="[16, 5, 20, 15]">
        <v-tooltip/>
        <v-smooth-area position="x*y"/>
      </v-chart>
    </div>
  </div>
</template>

<script>
//import {format} from 'date-fns'
// import axios from "axios";

// const data = []
//const CH4 = 0
//const beginDay = new Date().getTime()

//const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]
// for (let i = 0; i < fakeY.length; i += 1) {
//   data.push({
//     x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
//     y: fakeY[i]
//   })
//   data.push({
//     x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * 20), 'yyyy-MM-dd'),
//     y: fakeY[i]
//   })
//   data.reverse()
// }

const tooltip = [
 // 'x*y',
  (x, y) => ({
    name: x,
    value: y
  })
]

const scale = [{
  dataKey: 'x',

}, {
  dataKey: 'y',
  //title: '时间',

}]

export default {
  name: 'MiniArea',
  props: ['mylist'],
  data() {
    return {
      // data,
      scale,
      tooltip,
      height: 150,
      coverList: this.mylist,
    }
  },
  methods: {

  },

}
</script>

<style scoped>
.mini-chart {
  position: relative;
  width: 100%;
}

.mini-chart .chart-content {
  position: absolute;
  bottom: -28px;
  width: 100%;
}
</style>
